package com.neuedu.bean;


/**
 * 回复状态Bean：包括数据
 * @author 东软教育
 *
 */
public class RestBean<T> {
	private T data;//对应查询数据
	private long totalCount;//对应查询总条目数量
	private String msg;//前端显示内容
	private Integer status;//前端状态字符串：success/warning/info/error
	public RestBean() {
		super();
	}
//	分页有关构造器
	public RestBean(T data, long totalCount) {
		super();
		this.data = data;
		this.totalCount = totalCount;
		this.msg = "success";
		this.status = 200;
	}
//	无分页构造器
	public RestBean(T data) {
		super();
		this.data = data;
		this.msg ="success";
		this.status = 200;
	}
//	异常状态构造器
	public RestBean(Integer status,String msg){
		this.status=status;
		this.msg=msg;
	}
	public T getData() {
		return data;
	}
	public void setData(T data) {
		this.data = data;
	}
	
	public long getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	
	@Override
	public String toString() {
		return "RestBean [list=" + data + ", totalCount=" + totalCount + ", msg=" + msg + ", status=" + status + "]";
	}
	
}
